<?php
return array(
    'referer'       => 'http://toutiao.com',
    'useragent'     => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36',
    'source_name'   => '今日头条',
    'list' => array(
        'type' => 'page',
        'meta' => 'div.pin-content',
        'element' => array(
            'title' => array(
                'selection' => 'h3 a',
                'action'    => 'text'
            ),
            'source_url' => array(
                'selection' => 'h3 a',
                'action'    => 'attr',
                'attr'      => 'href'
            ),
            'publishtime' => array(
                'selection' => '.item_info td:eq(2)',
                'action'    => 'text',
                'function'  =>  array(
                    'strtotime' =>  '###',
                ),
            ),
            'cover' => array(
                'selection' => 'img:eq(0)',
                'action'    => 'attr',
                'attr'      => 'src',
                'replace'   =>  array(
                    'list'  =>  'large',
                )
            ),
            'hotnum' => array(
                'selection' => '.item_info td:eq(0)',
                'action'    => 'text',
                'replace'   => array(
                    '阅读: ' => ''
                )
            )
        )
    ),
    'page' => array(
        'author' => array(
            'selection' => 'span.Pgc_name a',
            'action'    => 'text'
        ),
        'content' => array(
            'selection' => 'div.article-content',
            'action'    => 'html',
            'format'    => array(
                'black_attr' => array(
                    '0' => 'img_width',
                    '1' => 'img_height',
                    '2' => 'onerror'
                )
            )
        ),
        'tags' => array(
            'selection' => 'ul.tag-list li',
            'action'    => 'text',
            'preg'      => array(
                '# +#'  =>  ',',
            )
        )
    )
);
?>
